package com.wc.alorithm_luogu.P1149;

import java.util.*;

/**
 * @Author congege
 * @Description
 * 火柴棒等式
 * https://www.luogu.com.cn/problem/P1149
 * @Date Created in 2023/9/22-16:19
 */
public class Main {
    int[] array = new int[]{6, 2, 5, 5, 4, 5, 6, 3, 7, 6};

    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);

        int n = scan.nextInt();

        Main main = new Main();
        int ans = 0;
        for (int i = 0; i <= 1000; i++) {
            for (int j = 0; j <= 1000; j++) {
                if (main.match(i)+ main.match(j)+ main.match(i+j)+4==n){
                    ans++;
                }
            }
        }
        System.out.println(ans);
    }

    /**
     * 计算该数字需要多少火柴
     *
     * @param num
     * @return
     */
    public int match(int num) {
        if (num == 0) {
            return array[num];
        }
        int ans = 0;

        while (num != 0) {
            ans += array[num % 10];
            num /= 10;
        }
        return ans;
    }
}
